<template>
  <div class="Mailbox">
    <div class="title">
      <div class="title-text">{{ title }}</div>
    </div>
    <div class="content flex justify-start items-center flex-wrap">
      <div v-for="(v, i) of listData" :key="i" class="item flex justify-start items-center ">
        <span class="circle"></span>
        <div class="cursor-pointer" @click="clickName(v)">
          {{ v.name }}（<span class="text-red-700">{{ v.num }}</span>,<span class="ml-2">{{ v.totle }}</span>）
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "",
    },
    listData: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  watch: {
    listData() {
      console.log("listData", this.listData);
    },
  },
  data() {
    return {};
  },
  methods: {
    clickName(v) {
      this.$emit('clickName', v)
    }
  }
};
</script>

<style lang='scss' scoped>
.Mailbox {
  height: 100%;

  .title {
    width: 100%;
    height: 1px;
    border-bottom: 1px dashed #698ab7;
    height: 34px;

    .title-text {
      text-align: center;
      line-height: 34px;
      width: 130px;
      height: 34px;
      background: linear-gradient(177deg, #3a8edc 0%, #2d72b2 100%);
      border-radius: 4px 4px 0px 0px;
      color: #fff;

    }


  }

  .content {
    padding: 18px;

    .circle {
      display: inline-block;
      width: 8px;
      height: 8px;
      background: #4986d9;
      border-radius: 50%;
      margin-right: 12px;
    }

    .item {
      height: 30px;
      width: calc(100% / 3);
    }
  }
}
</style>